package com.leigq.www.mybatisplusstudy.param;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.leigq.www.mybatisplusstudy.enums.GenderEnum;
import com.leigq.www.mybatisplusstudy.web.config.jackson.JacksonEnumDeserializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 添加员工接口参数
 * @author leiguoqing
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AddStaffsParam implements Serializable {

    private static final long serialVersionUID = 716278882890858054L;

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;


    /**
     * 性别
     * <br/>
     * {@link @JsonDeserialize}枚举类型反序列化局部配置，从前端接收枚举值反序列化为枚举对象,前端传 value 值
     */
    @JsonDeserialize(using = JacksonEnumDeserializer.class)
    private GenderEnum gender;


    /**
     * 工龄
     */
    private Integer workAge;

    /**
     * 工资(月)
     */
    private BigDecimal wages;

    /**
     * 部门id
     */
    private Long depId;


    /**
     * 爱好，可多个，存json
     * <br/>
     * <pre>
     *     typeHandler: 字段类型处理器
     *     注意！！ 必须开启映射注解 @TableName(autoResultMap = true)
     * </pre>
     *
     */
    private List<String> hobbies;

}
